﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace Tender.Tool.View
{
    /// <summary>
    /// 单据企业CompanyId不允许为空
    /// </summary>
    public partial class UserControl1 : UserControl
    {
        public UserControl1()
        {
            InitializeComponent();
        }
        public Action<string> Actionclick { get; set; }

        public Action screenshot { get; set; }
        private void uiButton1_Click(object sender, EventArgs e)
        {
            Actionclick?.Invoke(uiTextBox1.Text.Trim());
        }

        private void UIbutton2_Click(object sender, EventArgs e)
        {
            Image img = new Bitmap(Screen.AllScreens[0].Bounds.Width, Screen.AllScreens[0].Bounds.Height);
            Graphics g = Graphics.FromImage(img);
            g.CopyFromScreen(new Point(0, 0), new Point(0, 0), Screen.AllScreens[0].Bounds.Size);
            ScreenBody body = new ScreenBody();
            body.BackgroundImage = img;
            body.WindowState = FormWindowState.Maximized;
            screenshot?.Invoke();
            body.Show();
        }
    }
}
